package com.spr.controller;


import com.spr.service.SprDeviceInfoService;
import com.spr.vo.SprChargeStatisticsVO;
import com.spr.vo.SprDeviceInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sprDevicePushRecord")
@Slf4j
@Api(tags = "站点-控制类")
public class SprSiteController {

    @Autowired
    private SprDeviceInfoService sprDeviceInfoService;

    @ApiOperation(value = "收费统计")
    @GetMapping("/chargeStatistics")
    public ResponseEntity<List<SprChargeStatisticsVO>> chargeStatistics(){
        List<SprChargeStatisticsVO> sprChargeStatisticsVOS= sprDeviceInfoService.getChargeStatistics();
        return ResponseEntity.ok(sprChargeStatisticsVOS);
    }

    @ApiOperation(value = "部件类别统计")
    @GetMapping("/partStatistics")
    public ResponseEntity<List<SprDeviceInfoVO>> partStatistics(){
        List<SprDeviceInfoVO> sprDeviceInfoVOS= sprDeviceInfoService.getPartStatistics();
        return ResponseEntity.ok(sprDeviceInfoVOS);
    }








}
